package com.itheima.test01;

public class MathTest {
    public static void main(String[] args) {//Math方法练习
        //绝对值
        System.out.println(Math.abs(10));
        System.out.println(Math.abs(-10));

        //向上取整
        System.out.println(Math.ceil(10.1));

        //向下取整
        System.out.println(Math.floor(10.9));

        //最大值
        System.out.println(Math.max(10.9,10.0));

        //最小值
        System.out.println(Math.min(10,60));

        //四舍五入
        System.out.println("四舍五入");
        System.out.println(Math.round(10.95));
        System.out.println(Math.round(10.1111));

        //生成随机数,范围0.0-1.0
        System.out.println(Math.random());

        //a的b次方
        System.out.println(Math.pow(10,2));
    }
}
